home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / unix / src / utime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-24  |  379 b   |  23 lines

  1. #include "amiga.h"
  2. #include "timeconvert.h"
  3. #include <stdlib.h>
  4. #include <time.h>
  5. #include <utime.h>
  6.  
  7. int utime(char *file, struct utimbuf *times)
  8. {
  9.   struct DateStamp date;
  10.   time_t mtime;
  11.  
  12.   chkabort();
  13.   if (times) mtime = times->modtime;
  14.   else mtime = time(0);
  15.  
  16.   if (mtime == -1) return 0;
  17.  
  18.   _gmt2amiga(mtime, &date);
  19.  
  20.   if (SetFileDate(file, &date)) return 0;
  21.   ERROR;
  22. }
  23.